/*
 * @Description:
 * @Version: 1.0
 * @Autor: younghxp
 * @Date: 2022-05-16 16:16:38
 * @LastEditors: younghxp
 * @LastEditTime: 2022-05-16 16:17:35
 */
const getters = {
  keepAlive: function (state) {
    return state.keekAlives
  },
  newsNum: function (state) {
    return state.newsNum
  },
  videoShowSrc: function (state) {
    return state.videoShowSrc
  },
  eZhouprojectId: function (state) {
    return state.eZhouprojectId
  },
  eZhouprojectName: function (state) {
    return state.eZhouprojectName
  },
  isShowVideo: function (state) {
    return state.isShowVideo
  },
  eZhouArea: function (state) {
    return state.eZhouArea
  },
  pageNo: function (state) {
    return state.pageNo
  },
  collapse: function (state) {
    return state.collapse
  },
  noticeDate: function (state) {
    return state.noticeDate
  },
  selfEvaluateNumber: function (state) {
    return state.selfEvaluateNumber
  },
  assessEvaluateNumber: function (state) {
    return state.assessEvaluateNumber
  },
  getSliderBar: (state) => {
    if (state.sliderBar.length > 0) {
      return state.sliderBar
    } else if (localStorage.getItem('sliderBar')) {
      var tabList = JSON.parse(localStorage.getItem('sliderBar'))
      state.sliderBar = tabList
      return state.sliderBar
    } else {
      state.sliderBar = [
        {
          id: '/home',
          name: '首页',
          parentId: '0',
          url: '/home',
        },
      ]
      state.activeIndex = '/home'
      return state.sliderBar
    }
  },
  activeMenu: function (state) {
    return state.activeMenu
  },
  sliderBarTotal: function (state) {
    return state.sliderBarTotal
  },
  areaInfoArr: function (state) {
    return state.areaInfoArr
  },

  proposalData: function (state) {
    return state.proposalData
  },
  changeArea: function (state) {
    let arr = state.changeArea
    let curArr = []
    if (arr.length) {
      arr.forEach((item) => {
        curArr.push(item.areaId)
      })
    }
    return curArr
  },
}

export default getters
